<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
 <meta charset="utf-8">
 <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
 <title>商品推广</title>

 <link rel="stylesheet" type="text/css" th:href="@{/assets/css/bootstrap.min.css}">

 <link rel="stylesheet" type="text/css" th:href="@{/assets/fonts/line-icons.css}">

 <link rel="stylesheet" th:href="@{/assets/plugins/morris/morris.css}">

 <link rel="stylesheet" type="text/css" th:href="@{/assets/css/main.css}">

 <link rel="stylesheet" type="text/css" th:href="@{/assets/css/responsive.css}">

 <link rel="stylesheet" type="text/css" th:href="@{/css/common.css}">

 <script th:src="@{/assets/js/jquery-min.js}"></script>

</head>
<body>
<div class="app header-default side-nav-dark">
 <div class="layout">

  <div class="header navbar">
   <div class="header-container">
    <div class="nav-logo text-center" style="line-height: 65px;">
     <!--<a th:href="@{/admin/merchant/getList}" target="main_content">
      <b><img th:src="@{/assets/img/logo.png}" alt=""></b>
      <span class="logo"><img th:src="@{/assets/img/logo-text.png}" alt=""></span>
     </a>-->
     <span style="font-size: 1.5rem;color: #e22a6f;font-family: 'Arial Black', arial-black;">分销管理系统</span>
    </div>
    <!--<ul class="nav-left">
     <li>
      <a class="sidenav-fold-toggler" href="javascript:void(0);">
       <i class="lni-menu"></i>
      </a>
      <a class="sidenav-expand-toggler" href="javascript:void(0);">
       <i class="lni-menu"></i>
      </a>
     </li>
    </ul>-->
    <ul class="nav-right">
     <li class="user-profile dropdown dropdown-animated scale-left">
      <a href="#" class="dropdown-toggle" data-toggle="dropdown">
       <button type="button" class="btn btn-light btn-rounded">
        <span th:if="${session.userEntity.username != '' && session.userEntity.username != null}" th:text="${session.userEntity.username}"></span>
        <span th:unless="${session.userEntity.username != '' && session.userEntity.username != null}" th:text="${session.userEntity.phone}"></span>
       </button>
      </a>
      <ul class="dropdown-menu dropdown-md">
       <li>
        <ul class="list-media">
         <li class="list-item avatar-info">
          <div class="info" style="padding-left: 0px;">
           <div class="title text-semibold">
            <i class="lni-user"></i>
            <span th:text="${session.userEntity.realName}" style="padding-left: 6px;"></span>
           </div>
           <div class="sub-title">
            <i class="lni-phone-handset"></i>
            <span th:text="${session.userEntity.phone}" style="padding-left: 6px;"></span>
           </div>
          </div>
         </li>
        </ul>
       </li>
       <li role="separator" class="divider"></li>
       <li>
        <a th:href="@{/admin/user/userInfo(id=${session.userEntity.id})}" target="main_content">
         <i class="lni-highlight-alt"></i>
         <span>修改用户信息</span>
        </a>
       </li>
       <li>
        <a th:href="@{/admin/user/updatePw(id=${session.userEntity.id})}" target="main_content">
         <i class="lni-cog"></i>
         <span>修改密码</span>
        </a>
       </li>
       <li>
        <a href="/com/logout/admin">
         <i class="lni-exit"></i>
         <span>登出</span>
        </a>
       </li>
      </ul>
     </li>
    </ul>
   </div>
  </div>
  <div class="side-nav expand-lg">
   <div class="side-nav-inner">
    <ul class="side-nav-menu">
     <li class="side-nav-header">
     </li>

     <div id="userType" style="display: none" th:text="${session.userEntity.userType}"></div>

     <li id="productManager" class="nav-item dropdown open">
      <a href="#" class="dropdown-toggle">
       <span class="icon-holder"><i class="lni-dashboard"></i></span>
       <span class="title">商品管理</span>
       <span class="arrow"><i class="lni-chevron-right"></i></span>
      </a>
      <ul class="dropdown-menu sub-down">
       <li >
        <a href="/admin/merchant/getList" target="main_content" >商家列表</a>
        <a href="/admin/product/getList" target="main_content">商品列表</a>
       </li>
      </ul>
     </li>

     <li class="nav-item dropdown">
      <a class="dropdown-toggle" href="#">
       <span class="icon-holder"><i class="lni-control-panel"></i></span>
       <span class="title">订单管理</span>
       <span class="arrow"><i class="lni-chevron-right"></i></span>
      </a>
      <ul class="dropdown-menu sub-down">
       <li>
        <a id="orderDetails" th:href="@{/admin/order/getAll(id=${session.userEntity.id})}" target="main_content">详细订单</a>
        <a th:href="@{/admin/order/getAllByReferId(referId=${session.userEntity.id})}" target="main_content">下级订单</a>
       </li>
      </ul>
     </li>

     <li class="nav-item dropdown">
      <a class="dropdown-toggle" href="#">
       <span class="icon-holder"><i class="lni-control-panel"></i></span>
       <span class="title">用户管理</span>
       <span class="arrow"><i class="lni-chevron-right"></i></span>
      </a>
      <ul class="dropdown-menu sub-down">
       <li>
        <a id="userList" href="/admin/user/usersPage" target="main_content">用户列表</a>
        <a id="userSubordinateList" href="/admin/user/lowerPage" target="main_content">下级用户</a>
        <a id="userRefer" href="/admin/user/referPage" target="main_content">我的上级</a>
       </li>
      </ul>
     </li>


    </ul>
   </div>
  </div>


  <div class="index-page-container">
   <iframe src="/admin/merchant/getList" frameborder="0" name="main_content" ></iframe>
  </div>

 </div>
</div>

<div id="preloader">
 <div class="loader" id="loader-1"></div>
</div>

<script th:src="@{/assets/js/popper.min.js}"></script>
<script th:src="@{/assets/js/bootstrap.min.js}"></script>
<script th:src="@{/assets/js/jquery.app.js}"></script>
<script th:src="@{/assets/js/main.js}"></script>

<script th:src="@{/assets/plugins/morris/morris.min.js}"></script>
<script th:src="@{/assets/plugins/raphael/raphael-min.js}"></script>
<!--<script th:src="@{/assets/js/dashborad1.js}"></script>-->

<script type="text/javascript">
 $(function () {
  var userType = $("#userType").text();
  if (userType==1){
   $("#userRefer").hide();
  }else {
   $("#productManager").hide();
   $("#orderDetails").hide();
   $("#userList").hide();
  }

 })
</script>

</body>

</html>